package kcms.db;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Embeddable
public class ViewMessageId implements java.io.Serializable {
	private Integer messageid;
	private String description;
	private Date time;
	private String sender;
	private String receiverCsn;
	private String sid;
	private String realname;
    private String cname;
    private String cid;
    
    
	public ViewMessageId() {
		super();
	}

	public ViewMessageId(Integer messageid, String description, Date time,
			String sender, String receiverCsn, String sid, String realname,
			String cname, String cid) {
		super();
		this.messageid = messageid;
		this.description = description;
		this.time = time;
		this.sender = sender;
		this.receiverCsn = receiverCsn;
		this.sid = sid;
		this.realname = realname;
		this.cname = cname;
		this.cid = cid;
	}
	@Column(name = "messageid", nullable = false)
	public Integer getMessageid() {
		return messageid;
	}

	public void setMessageid(Integer messageid) {
		this.messageid = messageid;
	}
	@Column(name = "description", nullable = false)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "time")
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}
	@Column(name = "sender", nullable = false)
	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}
	@Column(name = "receiverCid", nullable = false)
	public String getReceiverCsn() {
		return receiverCsn;
	}

	public void setReceiverCsn(String receiverCsn) {
		this.receiverCsn = receiverCsn;
	}
	@Column(name = "sid", nullable = false)
	public String getSid() {
		return sid;
	}

	public void setSid(String sid) {
		this.sid = sid;
	}
	@Column(name = "realname", nullable = false)
	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}
	@Column(name = "cname", nullable = false)
	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}
	@Column(name = "cid", nullable = false)
	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}
	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ViewMessageId))
			return false;
		ViewMessageId castOther = (ViewMessageId) other;

		return ((this.getMessageid() == castOther.getMessageid()) || (this.getMessageid() != null
				&& castOther.getMessageid() != null && this.getMessageid().equals(
				castOther.getMessageid())))
				&&((this.getDescription() == castOther.getDescription()) || (this.getDescription() != null
				&& castOther.getDescription() != null && this.getDescription().equals(
				castOther.getDescription())))
				&&((this.getTime() == castOther.getTime()) || (this.getTime() != null
				&& castOther.getTime() != null && this.getTime().equals(
				castOther.getTime())))
				&&((this.getSender() == castOther.getSender()) || (this.getSender() != null
				&& castOther.getSender() != null && this.getSender().equals(
				castOther.getSender())))
				&&((this.getReceiverCsn() == castOther.getReceiverCsn()) || (this.getReceiverCsn() != null
				&& castOther.getReceiverCsn() != null && this.getReceiverCsn().equals(
				castOther.getReceiverCsn())))
				&&((this.getSid() == castOther.getSid()) || (this.getSid() != null
				&& castOther.getSid() != null && this.getSid().equals(
				castOther.getSid())))
				&&((this.getRealname() == castOther.getRealname()) || (this.getRealname() != null
				&& castOther.getRealname() != null && this.getRealname().equals(
				castOther.getRealname())))
				&&((this.getCname() == castOther.getCname()) || (this.getCname() != null
				&& castOther.getCname() != null && this.getCname().equals(
				castOther.getCname())))
				&&((this.getCid() == castOther.getCid()) || (this.getCid() != null
				&& castOther.getCid() != null && this.getCid().equals(
				castOther.getCid())));
	}
	public int hashCode() {
		int result = 17;
		result = 37 * result
				+ (getMessageid() == null ? 0 : this.getMessageid().hashCode());
		result = 37 * result
				+ (getDescription() == null ? 0 : this.getDescription().hashCode());
		result = 37 * result
				+ (getTime() == null ? 0 : this.getTime().hashCode());
		result = 37 * result
				+ (getSender() == null ? 0 : this.getSender().hashCode());
		result = 37 * result
				+ (getReceiverCsn() == null ? 0 : this.getReceiverCsn().hashCode());
		result = 37 * result
				+ (getSid() == null ? 0 : this.getSid().hashCode());
		result = 37 * result
				+ (getRealname() == null ? 0 : this.getRealname().hashCode());
		result = 37 * result
				+ (getCname() == null ? 0 : this.getCname().hashCode());
		result = 37 * result
				+ (getCid() == null ? 0 : this.getCid().hashCode());
		result = 37 * result
				+ (getCid() == null ? 0 : this.getCid().hashCode());
		return result;
	}

}
